﻿<cffunction name="antiSamy" access="public" hint="implement anti samy library from http://www.petefreitag.com/item/760.cfm">
	
	<cfargument name="str" default="" required="true"> 
		
	<cfset local.policyFile = GetDirectoryFromPath(GetBaseTemplatePath()) & "lib/antisamy-slashdot-1.4.1.xml">
	<cfset local.antiSamy = application.javaloader.create("org.owasp.validator.html.AntiSamy").init()>
	<cfset local.cleanResult = local.antiSamy.scan(arguments.str, local.policyFile)>
	
	<cfreturn local.cleanResult.getCleanHTML()>
	
</cffunction>